#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
  //int n = 0;
  //scanf("%d", &n);
  //printf("%d\n",n);
  //while(1)
  //{
  //printf("I am a process, pid: %d\n",getpid());
  //sleep(1);
  //}
 pid_t id = fork();
 if(id == 0)
 {
   // child
   int cnt = 5;
   while(cnt)
   {
     printf("I am child, cnt: %d, pid: %d\n",cnt,getpid());
     sleep(1);
     cnt--;
   }
 }
 else
 {
   // parent
   int cnt = 5;
   while(cnt)
   {
     printf("I am parent, running always!, pid: %d\n",getpid());
     sleep(1);
   }
 }


  return 0;
}
